package eclipse.util.maptools;
import com.sun.opengl.util.texture.*;
import eclipse.lib.map.*;
/** Map Editor. The map editor functions as a stand-alone application for building and modifying maps */
public class MapEditor 
{
	/** The MapEditor controls */
	public static MapToolkit 	toolkit;
	/** OpenGL Window that the map editor uses */
	public static MapWindow 	window;
	/** Collection of map files. */
	public static MapFile[]		map = new MapFile[0];
	/** Layer that is currently being edited */
	public static int 			currentLayer 	= 0;
	/** Map that is currently being edited */
	public static int			currentMap		= 0;
	/** Null texture. Used for shading */
	public static Texture		tBlank;
	public static void main(String args[])
	{
		toolkit		= new MapToolkit();
		window  	= new MapWindow();
	}
	/** Readjusts the size of the array of maps */
	public static void setMapCount(int nCount)
	{
		MapFile[] oldArray = map.clone();
		MapFile[] newArray = new MapFile[nCount];
		
		for(int i = 0; i < newArray.length; i++)
		{
			if(i < oldArray.length)
				newArray[i] = oldArray[i];
			else
				newArray[i] = new MapFile();
		}
		map = newArray;
	}
}
